LDCNN: A new arrhythmia detection technique with ECG signals using a linear deep convolutional neural network

Abstract The electrocardiogram (ECG) is a fundamental and widely used tool for diagnosing cardiovascular diseases. It involves recording cardiac electrical signals using electrodes, which illustrate the functioning of cardiac muscles during contraction and relaxation phases. ECG is instrumental in identifying abnormal cardiac activity, heart attacks, and various cardiac conditions. Arrhythmia detection, a critical aspect of ECG analysis, entails accurately classifying heartbeats. However, ECG signal analysis demands a high level of expertise, introducing the possibility of human errors in interpretation. Hence, there is a clear need for robust automated detection techniques. Recently, numerous methods have emerged for arrhythmia detection from ECG signals. In our research, we developed a novel one‐dimensional deep neural network technique called linear deep convolutional neural network (LDCNN) to identify arrhythmias from ECG signals. We compare our suggested method with several state‐of‐the‐art algorithms for arrhythmia detection. We evaluate our methodology using benchmark datasets, including the PTB Diagnostic ECG and MIT‐BIH Arrhythmia databases. Our proposed method achieves high accuracy rates of 99.24% on the PTB Diagnostic ECG dataset and 99.38% on the MIT‐BIH Arrhythmia dataset.

including ECGs (Berkaya et al., 2018), photoplethysmograms (PPGs) (González et al., 2023), arterial blood pressure (ABP) (Arvanaghi et al., 2017), cardiac output (CO) (Mehta & Arora, 2014), heart rate variability (HRV) (Brockmann & Hunt, 2023), and more.These signals vary in signal type, frequency domain, voltage, and measurement method, commonly utilized in the analysis of heart diseases.ECG is a prevalent noninvasive method for measuring heart rate, examining heart rhythm, and timely detecting cardiac irregularities (Alberdi et al., 2016;Merone et al., 2017).ECG records the heart's electrical signals during blood circulation throughout the body, producing insights into cardiac activity (Burgess, 2022).This signal comprises distinct waveform shapes (P, QRS, and T), with each shape representing specific cardiac activities.Various heart diseases manifest differently in ECG waveform shapes.The ECG signal comprises several leads, as illustrated in Figure 1 (a) the three primary leads (I, II, and III) and (b) the nine unipolar leads (V1-V6, aVR, aVL, and aVF).However, ECG signals face challenges such as noise, power line interference, baseline drift, and more (Friesen et al., 1990).ECG signal analysis requires extensive expertise due to its complexity and imperfections.Therefore, human error in ECG interpretation underscores the need for an efficient and accurate automated ECG detection system (Ribeiro et al., 2020).
Cardiac diseases encompass a range of cardiovascular conditions resulting from dysfunction of the heart and blood vessels.Among them, arrhythmia holds particular significance due to its impact on heart rhythm, rate, and regularity (Hu et al., 2022;Singh et al., 2019).Arrhythmias have various types classified based on their origin within the heart.Examples include ventricular arrhythmia, characterized by premature ventricular contractions (PVC), ventricular tachycardia (VT), and ventricular fibrillation (VF) (Mazidi et al., 2020).Ventricular premature contractions involve premature heartbeats originating from the Purkinje fibers rather than the sinoatrial node (Hurley et al., 2023).Ventricular tachycardia is marked by irregular and rapid heartbeats, with monomorphic ventricular tachycardia being the most common type (Zhang et al., 1999).Ventricular fibrillation (Wang et al., 2007) results in completely irregular and swift heartbeats in the ventricles, causing erratic contractions and trembling of the heart (Tseng & Tseng, 2020).Additionally, Torsades de Pointes, a form of polymorphic ventricular tachycardia characterized by a twisting pattern on the electrocardiogram, poses a distinct risk, especially in the context of prolonged QT intervals (Leenhardt et al., 2012).Supraventricular tachycardia (SVT) entails a faster-thannormal heart rate in the atria, with several variations (Grubb et al., 2020).Bradyarrhythmia manifests as a significantly slow heart rate, often associated with heart failure or sinus node dysfunction (Sidhu & Marine, 2020).We can categorize arrhythmias as either morphological, characterized by irregularities in the shape or structure of the heart's electrical signals, or rhythmic, caused by sets of irregular heartbeats.Accurate and timely diagnosis of cardiac arrhythmias is crucial, as these irregularities can manifest as disruptions in rhythm, alterations in conduction, or changes in repolarization patterns that may suggest underlying disease or altered physiological states.
Deep learning is a formidable approach within the machine learning domain, leveraging deep neural networks to extract high-level features from data.In the context of signal processing, the application of deep learning, particularly for the analysis of ECG signals, has proven to be highly effective and practical (Murat et al., 2020).Deep neural networks can identify and utilize significant latent features within ECG signals to classify and diagnose cardiac diseases (Liu et al., 2021).
In the field of arrhythmia detection, multiple methods for analyzing ECG signals exist, and we can categorize them into two main groups: non-deep learning-based methods, which include traditional machine learning algorithms or signal processing techniques, and deep learning-based methods.
1.1 | Non-deep learning-based methods Asl et al. (2008).proposed a classification algorithm for cardiac arrhythmias using heart rate variability (HRV) signals.They employed the MIT-BIH Arrhythmia Database to diagnose six different types of cardiac arrhythmias.Their approach improved the classification metrics by selecting optimal features and achieved accuracies of 98.94%, 98.96%, 98.53%, 98.51%, 100%, and 100% for six arrhythmia classes (2008).Hadj Slimane et al. (2010).introduced a novel algorithm for complex QRS detection using Empirical Mode Decomposition in ECG signals.This algorithm employed low-pass and high-pass filters, empirical mode decomposition of signals, and a nonlinear transformation.They evaluated their technique on the MIT-BIH dataset and achieved accuracy results of 95.58% accuracy, 99.84% sensitivity, and 99.92% specificity (2010).Kutlu et al. (2012) indicated an automated heartbeat detection method utilizing higher order statistics of wavelet packet decomposition coefficients.They classified using the K-Nearest Neighbors algorithm.The experiments were performed on the MIT-BIH dataset, resulting in an average sensitivity of 90%, average selectivity of 92%, and average specificity of 98% (2012).Raj et al. (2016) proposed a method for classifying cardiac arrhythmia beats using discrete orthogonal Stockwell transform (DOST) and Support Vector Machine (SVM) with Particle Swarm Optimization (PSO) tuning.The method was validated on the MIT-BIH dataset, achieving overall accuracies of 99.18% for 16 classes and 89.10% for five classes.PSO improved classification accuracy, with symmetry features contributing significantly to this improvement (2016).Sahoo et al. (2017).introduced an improved algorithm for detecting complex QRS features using the Multiresolution Wavelet Transform for classifying four types of ECG beats, including arrhythmias.Their approach's performance was evaluated for accuracy, sensitivity, and specificity on 48 ECG signals from the MIT-BIH dataset, reaching average accuracies of 96.67% and 98.39% in ANN (Artificial Neural Network) and SVM (Support Vector Machine), respectively (2017).Abdalla et al. (2019) in their research, focused on the Classification of ECG arrhythmias using nonlinear and nonstationary decomposition methods.They used the full ensemble empirical mode decomposition with adaptive noise (CEEMDAN) approach to extract the intrinsic mode functions (IMFs).They used the four parameters of these functions to construct the feature vector.Consequently, they used the artificial neural network to apply the feature vector and classify five different types of arrhythmia heartbeats using the MIT-BIH database.The results showed that the CEEMDAN and ANN approach performed very well, with 99.9% accuracy (2019).Zairi et al. (2020) introduced an FPGA-based arrhythmia detection system utilizing an artificial neural network for real-time cardiac disease detection.This method involved Wavelet Transform for feature extraction, a Multilayer Perceptron (MLP) for classification and arrhythmia detection, and decisionmaking based on the ANN output.The evaluation, conducted using the MIT-BIH dataset, resulted in an average sensitivity of 98.33% and an accuracy of 98.2% (2020).Gupta et al. (2020) utilized three techniques: a novel fractional wavelet transform (FrWT), Yule-Walker Autoregressive Modeling, and Principal Component Analysis (PCA) for denoising, feature extraction, and dimensionality reduction.They evaluated their approach on the MIT-BIH dataset, achieving an accuracy of 99.94% and 99.89% for the Real-time ECG and MIT-BIH databases, respectively (2020).Table 1 presents the advantages and disadvantages of each of the above approaches.

| Deep learning-based methods
While traditional machine learning techniques offer advantages, they often encounter challenges and are prone to errors in feature extraction, classification, and interpretation of ECG signals for heart disease detection.These conventional methods come with challenges such as complexity, the vast size of datasets, and ambiguity in detection, requiring parameter optimization and tuning.On the contrary, deep convolutional neural networks, among other deep learning approaches, leverage multilayer neural networks and automation to automatically extract features.They address some of the issues of traditional methods with lower complexity.
In our research, we develop a novel technique based on a one-dimensional deep convolutional neural network.

| Motivation
With the continuous evolution of medical diagnostics, the precise detection and classification of arrhythmias have gained paramount significance.Given the increasing prevalence of cardiovascular diseases, the necessity for accurate and efficient arrhythmia analysis techniques has become more critical than ever before.Among these techniques, the utilization of convolutional neural networks has demonstrated better outcomes.Traditional methods have shown limitations in handling the complex characteristics of ECG signals, often needing higher performance accuracy.Hence, our proposed deep linear convolutional neural network provides a comprehensive solution that overcomes the existing challenges.This paper addresses the unexplored potential of this technique and paves the way for innovative advances in enhancing heart health diagnostics.

| Datasets
We review the datasets utilized for simulating our proposed method, leveraging two widely employed benchmark datasets in contemporary research: the PTB Diagnostic ECG (Bousseljot et al., 1995;Kachuee et al., 2018) and MIT-BIH Arrhythmia (Moody & Mark, 2001)  2.2.2 | MIT-BIH Arrhythmia dataset   This is a standard dataset for the evaluation of various arrhythmia diseases.The dataset includes 48 dual-channel ECG recordings, each lasting 30 min, collected from 47 patients over 4 years.It comprises five categories: normal beat, ventricular premature contraction, supraventricular premature beat, combined ventricular and normal beat, and unclassifiable beat.For this study, we selected a subset of these arrhythmias based on their clinical relevance and prevalence in real-world scenarios.The selection process aimed to focus on representative arrhythmias to ensure a robust evaluation of our proposed methodology.
Refer to Table 4 for the detailed breakdown of heartbeats in the MIT-BIH Arrhythmia dataset.Table 5 provides an overview of the subset of heartbeats used in this article, along with their respective annotations, frequencies, and class labels.

| Proposed method
ECG signals are acquired and recorded in digital format, utilizing Analog-to-digital converters (ADCs) during the data acquisition process, subsequently forming the basis for the creation of datasets like MIT-BIH and PTB.Advanced digital signal processing techniques are then applied for preprocessing and data conditioning, enabling the extraction of high-level features by a deep convolutional neural network (DCNN).In Figure 2, we visually represent an example of analog signals from the MIT-BIH Arrhythmia dataset using the Matplotlib library to illustrate how we use the data in our proposed model.The horizontal axis depicts the index of each sample, and the vertical axis represents the corresponding voltage values.We select a specific range of observations from index 30 to 50, transforming them into a vector named "a."Additionally, two random samples from this range are chosen, and their values are mentioned.This selected range is transformed into a vector called "a" and displayed.This reshaping and conversion into vectors, as detailed in phase (v) of our methodology, are crucial steps in preparing the data for subsequent processing.These vectors serve as inputs to the model.Our proposed methodology comprises seven distinct phases: (i) data preprocessing and preparation, (ii) class balancing, (iii) data separation, (iv) data encoding, (v) data reshaping and vectorization, (vi) high-level feature extraction utilizing LDCNN and classification, and (vii) model testing and evaluation.Figure 3 illustrates the general framework for ECG signal arrhythmia detection.In the following, we have discussed each of these phases.

| Data preprocessing and preparation
After converting the signals into digital form, we propose this process, which consists of five steps, to increase the accuracy and reliability of the classification process.

Denoising ECG signals
ECG signals may contain errors due to noise, including interference from power lines.Such interference can reduce the accuracy of the analysis and lead to errors in diagnosing arrhythmia.Denoising is an approach to deal with these problems and increase the accuracy of ECG signal analysis.The Wavelet Thresholding method is a noise removal method that effectively separates the unwanted signal components from the desired signal and protects the key characteristics of the signal.This method is used if there is significant noise in the data.For example, this technique has been applied to the MIT-BIH Arrhythmia dataset.Figure 4 shows instances of ECG signals (a) before and (b) after applying the denoising method.

ECG signal normalization
Normalizing the data of ECG signals can significantly improve the accuracy of ECG signal analysis.Through

Beat description Heartbeats
Normal normalization, we can transform the signal data onto a common scale and mitigate the effects of scale variations between different units.If the dataset features are not in a common scale, we have employed the z-score technique for signal normalization.First, we calculate the data's mean and then compute the standard deviation.Then, using the z-score method, we transform each point of the signal in a way that the mean becomes zero and the standard deviation becomes one.This process aligns the data within a specific range, making them comparable.

Reading annotations files
Reading annotations refers to the process of extracting information related to each heartbeat in a signal.Annotations typically provide additional information about events or specific features in the signal, such as the positions of R-peaks (the highest point of the QRS complex in an ECG signal) and the corresponding arrhythmia class (such as normal beat, premature ventricular contraction).
They contain information about the timing or location of important events in the signal and are often used for labeling signal data for further analysis or classification tasks.
Due to the annotation files in the MIT-BIH Arrhythmia dataset, we utilize this process.By reading annotation files, we can extract information related to each sample and utilize it in subsequent phases.This information is crucial for tasks like heartbeat classification and analysis, enabling us to understand the characteristics of each beat and make informed decisions based on the extracted features and annotations.

ECG signal segmentation
After F I G U R E 3 The general schema of our proposed method for arrhythmia detection from ECG signals.

| Data splitting
The data segmentation strategy is a significant step in preparing datasets for training and testing machine learning models.After resampling, we separated the data into two sets for training and testing, where the testing set contains 20% of the total data.This is done to evaluate the performance of the model and ensure that the model works correctly on new data.

| Data encoding
Encoding techniques in the field of machine learning refer to the process of converting categorical data into a numerical format that can be easily processed by machine learning algorithms.Categorical data includes labels or categories that do not have a natural numeric representation.Machine learning algorithms usually require numerical inputs, which is why encoding is essential.We have used the One-Hot Encoding method in this section.In this method, we convert categorical data into binary vectors.If there are two categories for a categorical variable, it is often coded as the numbers zero and one.However, if suppose the categorical variable has more than two categories in a dataset, in that case, we usually treat each category as a binary feature and then convert these binary features to numeric values.According to the MIT-BIH Arrhythmia dataset, it is assumed that there is a variable called arrhythmia in this dataset, whose values are "Normal beat," "Right bundle branch block beat," "Left bundle branch block beat," "Atrial premature beat," and "Premature ventricular contraction."As shown in Table 7, all the values of this variable are converted into five separate columns with five samples.Now, for the first sample, which is "Normal beat," the number 1 is entered in the Normal beat column and zero in the rest of the columns.For the second sample, which is "Right bundle branch block beat," in the columns "Normal beat," "Left bundle branch block beat," "Atrial premature beat," and "Premature ventricular contraction," the value is zero, and, in the column, "Right bundle branch block beat," "The value one is entered.It is done in the same way for other samples." 2.3.5 | Data reshaping and vectorization The data are represented as a tensor with the shape (rows, columns, layers, and number of samples).We have transformed the input data to have a third dimension of size one.In our research and code implementation, the process of data reshaping plays an essential role in preparing our datasets for neural network training.This process involves transforming the input data arrays to conform to the specific structure required by the neural network architecture and is very important when working with CNNs, especially when handling one-dimensional signals such as ECG data.This step is integral to the preprocessing step and serves as an effective strategy to handle class-specific irregularities in diverse datasets, thereby increasing the flexibility and accuracy of ECG signal analysis.After doing this, we have applied the vectorization process.A process in which data, often represented as an array or matrix, is converted to a one-dimensional vector.This transformation facilitates ease of processing for algorithms and operations designed to work with linear data.one-dimensional deep convolutional neural network.
In this technique, one-dimensional linear convolution is used deeply, which means using several layers.Using this method, we can extract high-level features from the ECG signal and recognize patterns.The use of convolution in this technique helps us to extract important features due to the unknown location of arrhythmia and the absence of a specific time to observe cardiac arrhythmia.
The data are one-dimensional and in the form of an input signal.But when these signals are sampled, they become a vector form of a one-dimensional tensor.Therefore, by using linear convolution, we can extract patterns from these vectors and recognize the moment of the event based on the previous steps.For this reason, this technique is known as LDCNN, and its use increases the accuracy.The general structure of our proposed model is shown in Figure 7.
In the LDCNN architecture for PTB Diagnostic ECG and MIT-BIH Arrhythmia dataset, eight and five convolution layers are considered, respectively, and each of these layers is associated with a pooling layer.After the flattening layer, a dropout layer is subsequently applied to generate the final feature vector.Tables 8 and 9 contain information about each architecture and hyperparameters of each.

| Performance evaluation
After training the model, it is employed to test on a separate test dataset, and a range of evaluation criteria are assessed accordingly.Various critical evaluation criteria are used to measure the efficiency of the proposed method.Some of these criteria are as follows:

Accuracy
Accuracy, as defined by Equation 1, serves as a metric that measures the overall correctness of a model by representing the proportion of correctly identified samples in the entire dataset.Equations use True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN) to quantify correct and mistaken identifications.
Accuracy is a commonly used metric to assess the overall performance of a classification model.

Precision
Precision, outlined in Equation 2, functions as a gauge for the reliability of positive predictions, indicating the proportion of true positives among all samples classified as positive.4, is a composite measure that balances precision and recall, providing a single value for the evaluation of the model's overall performance.

| Additional details
In  The accuracy of our proposed method achieves a high accuracy rate of 99.38% on this dataset.In Table 10, our proposed model demonstrates robust classification performance on both the MIT-BIH Arrhythmia and PTB Diagnostic ECG datasets, achieving high accuracy rates and class-specific metrics.Table 11 summarizes the obtained results, showcasing impressive F1 scores, recall, precision, and overall accuracy for the proposed model across different evaluation metrics and epochs on the two datasets.

| Assessment of various machine learning methods
In addition to our proposed deep learning model, we implemented and evaluated various machine learning techniques across two datasets.The results obtained for both datasets are shown in Tables 12 and 13.It can be seen in Table 12 that our proposed method performs better than the machine learning methods in the MIT-BIH arrhythmia dataset based on F1 score, recall, precision, and accuracy.In Table 13 for the PTB Diagnostic ECG dataset, the competition between classical classification and clustering methods can be seen.These results show that our proposed method performs better than different basic machine learning algorithms according to the four evaluation indicators.

| Comparison with different contemporary techniques
We have conducted a comparison between the proposed LDCNN method and several modern techniques in the context of arrhythmia detection.For the evaluation, we utilized the two datasets and considered all the evaluation metrics outlined in the Methods Section.According to Table 14, our proposed method has shown the best performance for all criteria compared to contemporary methods in the MIT-BIH Arrhythmia dataset.Furthermore, Fradi et al. achieved     In this research, we perform a comparative analysis involving five previously proposed methods from recent advances.Our goal was to evaluate and benchmark our technique against these established methods.A summary of the advantages and disadvantages of each approach is presented in Table 16.
1. Cardiac arrhythmia classification from ECG signals using a 16-layer deep convolutional network (Yıldırım et al., 2018): a.This approach employs a 16-layer deep convolutional network with a 1D-CNN architecture.This network can perform classification automatically using an end-to-end structure.The preprocessing of the signals involved three steps: one without normalization, another with signal rescaling within the (Singh et al., 2019)  The bolding indicates that these results are particularly noteworthy and represent key findings of our study.
T A B L E 1 2 Assessing the efficacy of our novel model against various machine learning methods using the MIT-BIH Arrhythmia dataset.This approach has been trained using two MIT-BIH and PTB Diagnostic ECG datasets, and its accuracy has reached 98% and 0.95% in both datasets, respectively, in 2023.In response to RQ1, our linear deep convolutional neural network (LDCNN) achieves remarkable diagnostic effectiveness, boasting 99.24% accuracy on PTB and 99.38% on MIT-BIH datasets.Addressing RQ2, the LDCNN consistently outperforms traditional methods, surpassing them in F1 scores, precision, recall, and overall accuracy.RQ3 findings reveal the LDCNN's consistent diagnostic accuracy across arrhythmia classes.Finally, RQ4 highlights stable training trends, absence of overfitting, and effective convergence, affirming the LDCNN's adaptability and robust learning, ultimately contributing to its efficacy in cardiac disease diagnosis across diverse datasets.

Methods
T A B L E 1 5 Comparative analysis of our innovative LDCNN technique for arrhythmia detection with a range of contemporary techniques using the PTB Diagnostic ECG dataset, with metrics for all listed techniques taken directly from their respective publications.

Techniques
Accuracy (%) Precision (%) Recall (%) F1 score (%) The bolding indicates that these results are particularly noteworthy and represent key findings of our study.
In our simulation on the MIT-BIH and PTB datasets, we achieved remarkable maximum accuracies of 99.38% and 99.24%, respectively.Our approach involves processing digital data directly, converting it into vectors, and utilizing datasets as digital numbers.Despite the one-dimensional nature of the data, our method adeptly addresses denoising and other issues, automatically identifying patterns for arrhythmia detection.The high accuracy underscores the success of our architecture in solving the problem without the need for analog-to-digital conversion or sampling.
The strength of our method lies in its direct approach to digital data processing, eliminating errors associated with sampling.The proposed LDCNN method effectively covers potential errors related to sampling, ensuring signal quality and accuracy without the need for additional conversion steps.This result demonstrates the correctness and efficacy of our approach.

| Future works
According to the obtained results and considering the observed needs, future research could explore the integration of additional characteristics such as blood pressure and cholesterol levels with arrhythmia signals.Additionally, developing an Internet of Things (IoT) device to predict and detect arrhythmias in real-time, and employing artificial intelligence for long-term ECG data analysis, could significantly enhance personalized treatment plans.Ensuring data security through blockchain technology could also be a valuable approach to protect patient privacy while allowing for broader analysis of anonymized data.the following DOI: https:// doi.org/ 10. 13026/ C2F305.You can access this dataset by visiting the provided DOI.Dataset 2 (PTB Diagnostic ECG dataset): The PTB Diagnostic ECG dataset is accessible through the following DOI: https:// doi.org/ 10. 13026/ C28C71.Additionally, the annotated PTB dataset is available on Kaggle at https:// www.kaggle.com/ datas ets/ shaya nfaze li/ heart beat.

CODE AVAILABILITY
The code, including the deep learning and machine learning models, preprocessing scripts, and architectures with Python, used in this study, is available at the following GitHub repository: https:// github.com/ alieb ayani/ Linea r-Deep-Convo lutio nal-Neura l-Netwo rk-LDCNN.git.

Figure 5
Figure 5 (a) illustrates an example of ECG signals after applying the normalization method to the MIT-BIH Arrhythmia dataset.
completing the previous steps, the focus shifts to the vital components of the signal waves.In this context, segmentation is performed to extract only the necessary segments for model training.It is crucial to emphasize that a comprehensive view of the entire conduction cycle, including the P wave in PQRST, is essential for accurate delineation of specific heart blocks like SA or AV block, and for distinguishing between variations within each.Additionally, without consideration of the complete conduction cycle, differentiation between premature atrial contractions (PACs) and premature ventricular contractions (PVCs), as well as discerning non-conducted PACs from AV block, can be challenging.In this phase, we utilize a technique called fixedsize window segmentation and specifically extract the R-peak from the ECG signals.The R-peak, representing the peak of the QRS complex in the ECG signal, offers crucial information about heart rate and cardiac abnormalities.It is the distance from the beginning of the QRS complex to the maximum point of the R wave.The fixedsize window segmentation involves extracting sections (windows) with a predefined and fixed length from the ECG signal, enhancing clarity and focus.Figure5(b) illustrates the segmentation of the ECG signal.Class labelingIn this step, labels are assigned to the segmented ECG signal data based on the arrhythmia classes associated with each heartbeat.This process is necessary to train a machine learning model to accurately classify different types of arrhythmias.To obtain arrhythmia class information, we use annotations associated with ECG signals.Annotations provide details about the type of each heartbeat event.
Split the resampled data into training and testing sets (The testing set size is set to 20% of the total data) Step 4: Encoding data Convert the target class labels in the training and testing sets to one-hot encoded vectors Step 5: Reshaping and vectorization the data Reshape the input data (train_x and test_x) to have a third dimension of size 1 and vectorization Step 6: Defining CNN model Feature extraction and classification using CNN then training and testing Step 7: Performance evaluation Evaluation the model's accuracy and different performance metricsIs the data quality not good and has significant noisethey can represent classes such as A (atrial premature), R (right bundle branch block), L (left bundle branch block), V (premature ventricular contraction), N (normal), or abnormal.Tables3 and 5contain information about the classes within each dataset.2.3.2 | Class balancingNormally, the uneven distribution in the number of samples of different classes of a dataset leads to problems in the field of ECG signal analysis.To solve these challenges and improve the efficiency of machine learning models, we have used the resampling technique.This technique involves generating additional samples from the minority class to achieve a more balanced distribution of samples among the different classes.Figure6illustrates the number of samples in the MIT-BIH Arrhythmia dataset, with (a) showing the class distribution before and (b) showing the distribution after resampling.Additional details are provided in Table

F
I G U R E 4 ECG signal (a) before and (b) after denoising.F I G U R E 5 (a) ECG signal after normalization and (b) segmented ECG signal or beat from this wave.
2.3.6 | Definition of LDCNN Our proposed technique, known as linear deep convolutional neural network (LDCNN), consists of a linear F I G U R E 6 Resampling for balancing the classes of the MIT-BIH Arrhythmia dataset: (a) class distribution before and (b) after resampling.
Equation 3 defines Recall, which assesses the model's ability to detect positive instances by representing the proportion of true positives among all actual positive samples.(1)Accuracy = TP + TN TP + TN + FP + FN The count of samples from distinct classes in the MIT-BIH Arrhythmia dataset both before and after the resampling process.T A B L E 7 Encoding classes for the MIT-BIH Arrhythmia dataset.

|
Evaluation of our proposed deep learningWe implemented the proposed model in Python on Google Colab as well as on a CPU with 8 GB RAM, utilizing an AMD Ryzen 55,500U processor with Radeon Graphics (running at 2.10 GHz).Figure8(a) illustrates the accuracy trends of model training and testing over 30 epochs on the PTB dataset.The blue curve represents changes in training set accuracy, while the orange curve represents changes in test set accuracy.Furthermore, Figure 8 (b) displays the loss trends of model training and testing across 30 epochs for the PTB dataset.The blue curve depicts changes in training set loss, while the orange curve portrays changes in test set loss.According to these results, it is possible to evaluate how much the model has improved during training and how well it maintains its performance in the test set.The accuracy of our proposed method achieves a high accuracy rate of 99.24% on this dataset.The results of model training and testing accuracy during 80 epochs for the MIT-BIH Arrhythmia dataset are shown in Figure 8 (c).As shown in the figure, the blue and orange curves represent the accuracy of the training set and the test set, respectively.Also, Figure 8 (d) shows the loss of model training and testing during 80 epochs for this dataset.The blue and orange curves represent the loss in the training set and the test set, respectively.As is evident, overfitting does not occur.

F
second-best based on precision for the PTB Diagnostic ECG Additionally, Pham et al. secured the second-highest ranking among performers, with Sharma et al. exhibiting the lowest level of accuracy.These analyses show that our proposed method has been validated for both the PTB and MIT-BIH datasets as an efficient and T A B L E 8 The diverse hyperparameters used in configuring our LDCNN model for the MIT-BIH Arrhythmia dataset.

F
I G U R E 8 (a) Improvement in model training and testing accuracy on the PTB diagnostic ECG dataset, (b) loss trend during epochs on the PTB diagnostic ECG dataset, (c) improvement in model training and testing accuracy on the MIT-BIH Arrhythmia dataset, and (d) loss trend across epochs on the MIT-BIH Arrhythmia dataset.accuratemethod for detecting arrhythmias in terms of various criteria.
Summary of previous works and their advantages and disadvantages.This technique aims to extract vital information from cardiac signals across various frequencies and represent them as vectors instead of images, reducing errors.Moreover, we have significantly improved this algorithm's complexity and execution time.For this reason, we have introduced it as a one-dimensional linear deep convolutional neural network (LDCNN).
T A B L E 1 • Research Question 3: How does the diagnostic accuracy of the LDCNN model vary across different arrhythmia classes, and what insights can be gained from the precision, recall, and F1-score metrics for each class across diverse datasets?• Research Question 4: What trends are observed in the training and testing accuracy, as well as loss, during the training epochs of the LDCNN model, and how do these trends contribute to the model's overall effectiveness in diagnosing cardiac diseases across various datasets?
Types of heartbeats we used in the PTB diagnostic ECG dataset and overview of its beat annotations.
datasets. 2.2.1 | PTB Diagnostic ECG dataset PTB Diagnostic ECG includes a set of samples that are used to diagnose cardiovascular abnormalities.This dataset contains 549 records from 290 people.Each record contains 15 signals measured simultaneously, and these signals consist of 12 leads.This dataset includes two classes, normal and non-normal.Table 2 contains the different types of heartbeats available in the PTB Diagnostic ECG dataset.Table 3 contains the heart rate types used in this article for this dataset and contains information about each one.Abnormal Abnormal Cardiomyopathy/heart failure, myocarditis, and myocardial infarction Miscellaneous, bundle branch block, dysrhythmia, valvular heart disease, and myocardial hypertrophy 72.19 10,506 addition to the MIT-BIH Arrhythmia examples, within the context of the PTB Diagnostic ECG dataset, our implemented CNN model, referred to as the linear deep convolutional neural network (LDCNN), serves as a valuable tool for associating nuanced waveform features with specific cardiac diseases.The model is designed to differentiate between disease types based on subtle patterns identified in ECG signals.The utilization of the PTB dataset allows our LDCNN to capture and process waveform nuances associated with various cardiac conditions, contributing to the accurate classification of different disease types.This approach enables the identification of novel markers of disease within ECG waveforms, providing insights into unique patterns that may not require processing data through the LDCNN itself.The LDCNN thus proves to be a valuable asset in detecting and understanding nuanced markers of cardiac diseases, enhancing its applicability and potential for novel disease marker discovery.However, it is important to note that our technique is invented to be adaptable and applicable to various datasets.Its strength lies in its ability to be employed across different datasets, offering a versatile solution for cardiac disease diagnosis.
ally resampled.Then, the data are divided into training and test sets, and if there are more than two arrhythmia classes, one-hot encoding is applied.The data are then transformed and fed into a convolutional neural network feature extractor, followed by training a CNN.The trained CNN is used to predict arrhythmia labels for the test set, and performance metrics are calculated and returned.
the second-highest performance, whereas Atal et al. exhibited the least accuracy.As indicated by the results presented in Table 15, our proposed method outperforms other contemporary techniques based on Accuracy, Recall, and F1 score, and ranks as the The diverse hyperparameters used in configuring our LDCNN model for the PTB diagnostic ECG dataset.
Comparison of classification performance metrics for each class and dataset characteristics in MIT-BIH Arrhythmia and PTB Diagnostic ECG datasets.The obtained results of our proposed model for four evaluation metrics for two used datasets.
T A B L E 1 1 (Amari, 1993)019)., 2019), and SGD(Amari, 1993)are used.Also, to improve the performance of the neural network model, gradient optimizers are used to optimize the classification results and accuracy.Evaluation of indices for accuracy, F1-score, sensitivity, and specificity to the values of 95%, 99%, 99.32%, and 99.63% for MIT-BIH and to the values of 99.61%, 99%, 98.66%, and 98.85% for PTB in the year 2021 has been achieved.5. Integrating Fuzzy Clustering and Deep Neural Networks for Heart Failure Diagnosis with ECG Data (Kumar et al., 2023): a.This mechanism uses a framework based on deep learning and fuzzy clustering to detect arrhythmia from ECG signals.In this approach, the initial step involves preprocessing to eliminate noise from the ECG signals.Then, it uses the technique of segmenting ECG signals and balancing the classes of the dataset.The performed operations are transferred to deep convolutional neural network architecture to extract features.Finally, they employed the fuzzy clustering algorithm to classify arrhythmias, with the input being the extracted features.
(Li et al., 2020))tes that these results are particularly noteworthy and represent key findings of our study.nals.In the next step, a fully connected layer based on convolutional neural networks is trained with different optimizers.In the training process, deep learning methods and various network optimizers such as Adam(Fei et al., 2020), Nadam(Li et al., 2020),